/* Copyright 2010 John L. Reilly

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */

package com.riq.entity;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;

//import com.google.appengine.api.datastore.DatastoreService;
//import com.google.appengine.api.datastore.DatastoreServiceFactory;
//import com.google.appengine.api.datastore.Entity;
//import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Status implements Serializable {
    
  private static final long serialVersionUID = 1L;

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  @GeneratedValue(strategy=GenerationType.IDENTITY) 
  private Long key;  
      
	@Persistent
	private Long deptId;
  
	@Persistent
	private String shortName; 
	
	@Persistent
	private String longName;
	
	@Persistent
	private String type;
	
	public Status(Long deptId, String shortName, String longName, String type) {
	  this.setkey(key);
	  this.deptId = deptId;
	  this.shortName = shortName;
	  this.longName = longName;
	  this.type = type;	
	}
  
//  public Map<Key, Entity> getByKeys(List<Long> keys) { 
//    DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); 
//    return ds.get(keys); 
//  } 
    
	
// VERBS
	
  public boolean ownedByDept(final Department d) {
    return this.deptId.equals(d.getid());
  }
  
  
// GETS

  public Long getid() {
    return key;
  }

	public Long getdeptId() {
		return deptId;
	}
  
	public String getshortName() {
		return shortName;
	}

	public String getlongName() {
		return longName;
	}
	
	public String gettype() {
		return type;
	}

// SETS
	
  public void setkey(Long key) {
    this.key = key;
  }
	
	public void setdeptId(Long deptId) {
		this.deptId = deptId;
	}
	
	public void setshortName(String shortName) {
		this.shortName = shortName;
	}
	
	public void setlongName(String longName) {
		this.longName = longName;
	}
	
	public void settype(String type) {
		this.type = type;
	}

}